package com.example.demo.base.exceptions;


import com.example.demo.base.bean.Meta;

public class BaseException extends RuntimeException{
    private Meta meta;

    private int code;
    private int status;
    private String message;
    public BaseException(Meta meta){
        this.meta = meta;
        this.message = meta.getMessage();
        this.status = meta.getCode();
        this.code =meta.getCode()==200?1:0;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
